package org.lboot.flow.module.process;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.lboot.jpa.jpa.AbstractJpaCurdExt;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
@AllArgsConstructor
public class FlowProcessServiceImpl extends AbstractJpaCurdExt<String,FlowProcess,FlowProcessDAO> implements FlowProcessService{
    @Override

    public void deleteByFlowWorkId(String flowWorkId) {
        dao.deleteByFlowWorkId(flowWorkId);
    }

    @Override
    public List<FlowProcess> getAll(Specification<FlowProcess> specification) {
        return dao.findAll(specification);
    }

    @Override
    public List<FlowProcess> getByFlowIds(List<String> ids) {
        return dao.findByFlowWorkIdIn(ids);
    }
}
